#!/usr/bin/env node

const http=require('http'),
      log=console.log;


    
http.createServer((req,res)=>{
  if(req.url!=='/'){
    res.statusCode=404;
    res.setHeader('Content-Type','text/html');
    res.end('<h1>Not Found</h1>')
    return
  }

  //获取请求体的数据将数据打印在控制台中
  req.pipe(process.stdout);

  

  res.end('ok');
  

}).listen(8080);
